Skip to content

Conversation

@idoshamun
Copy link
Member

@idoshamun idoshamun commented Jan 8, 2026

Summary

This PR implements Phase 2 of the Flexible Social Media Links refactor on the frontend. It replaces the 13 individual social media input fields with a unified, flexible socialLinks array that supports auto-detection of platforms from URLs.

Changes

  • New SocialLinksInput component - Single URL input with platform auto-detection and visual feedback ("GitHub detected ✓")
  • Updated useUserInfoForm hook - Manages socialLinks array with backwards compatibility for legacy fields
  • Extended platform detection - Added support for Threads, Bluesky, Mastodon, Roadmap, CodePen, Reddit, Hashnode
  • Updated profile display components - Both AboutMe components prefer socialLinks array with fallback to legacy fields
  • Updated TypeScript interfaces - Added UserSocialLink type and socialLinks field to user interfaces
  • Updated GraphQL queries - Added socialLinks { platform url } to relevant queries

Related Issues

  • ENG-251: Extend platformDetection.tsx with all profile social platforms
  • ENG-252: Update frontend user interfaces and GraphQL queries
  • ENG-253: Update profile display components to use socialLinks array
  • ENG-254: Refactor profile edit form to URL-only input with auto-detection

Test plan

  • Verify profile edit form shows new URL input instead of 13 individual fields
  • Test adding a GitHub URL and verify "GitHub detected ✓" feedback appears
  • Test adding LinkedIn, Twitter, YouTube URLs and verify correct detection
  • Test adding unknown URL and verify it's added as "Link"
  • Test removing links from the list
  • Verify profile display shows social links correctly
  • Verify backwards compatibility with existing users who have legacy field data

Preview domain

https://flexible-links-phase-2.preview.app.daily.dev

Adds support for user profile social platforms to the platform detection utility:

New platforms:
- Threads (threads.net)
- Bluesky (bsky.app)
- Mastodon (common instances + URL pattern detection for /@username)
- Roadmap (roadmap.sh)
- CodePen (codepen.io)
- Reddit (reddit.com)
- Hashnode (hashnode.com, hashnode.dev)

Also adds corresponding SocialMediaType enum values for the new platforms.

Closes ENG-251
Updates TypeScript interfaces and GraphQL queries to support the new
socialLinks array field:

- Add UserSocialLink interface (platform, url)
- Add socialLinks field to PublicProfile and UserProfile interfaces
- Add socialLinks to USER_BY_ID_STATIC_FIELDS_QUERY
- Add socialLinks to UPDATE_USER_PROFILE_MUTATION response
- Add socialLinks to UPDATE_USER_INFO_MUTATION response
- Mark individual social fields as @deprecated

Legacy fields kept for backwards compatibility during migration.

Closes ENG-252
Updates AboutMe components to render social links from the new array structure:

- Add PLATFORM_CONFIG mapping for icons and labels
- Add mapSocialLinksToDisplay() for converting socialLinks to display format
- Add buildLegacySocialLinks() as deprecated fallback for legacy fields
- Prefer user.socialLinks when available, fall back to legacy fields
- Support all 13 platforms with proper icons
- Unknown platforms fall back to generic LinkIcon

Backwards compatible: existing users without socialLinks populated
will still see their links from legacy fields.

Closes ENG-253
Replace 13 individual social media input fields with a unified SocialLinksInput
component that uses URL-based platform auto-detection.

- Add SocialLinksInput component with platform detection and visual feedback
- Update useUserInfoForm hook to manage socialLinks array
- Update Profile settings page to use new SocialLinksInput
- Add backwards compatibility for users with legacy individual fields
@vercel
Copy link

vercel bot commented Jan 8, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
daily-webapp Ready Ready Preview Jan 8, 2026 7:30pm
1 Skipped Deployment
Project Deployment Review Updated (UTC)
storybook Ignored Ignored Jan 8, 2026 7:30pm

return null;
}
// Map socialType enum values to our platform identifiers
const platformMap: Record<string, string> = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can do some typescript magic here to ensure that what's defined in PLATFORM_CONFIG must be in this map

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or the SocialMediaType enum

/**
* Platform icon and label mapping for socialLinks
*/
const PLATFORM_CONFIG: Record<string, { icon: ReactElement; label: string }> = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this defined twice 🙈

/**
* Platform icon and label mapping for socialLinks
*/
const PLATFORM_CONFIG: Record<string, { icon: ReactElement; label: string }> = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean, thrice?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, why is there two AboutMe.tsx components? 🙈

@idoshamun
Copy link
Member Author

@omBratteng haven't reviewed it yet. hence it's draft. there could be some hallucinations here

- Create socialLink.tsx with shared PLATFORM_LABELS, PLATFORM_ICONS, and helper functions
- Add SocialPlatform type for exhaustive type checking on platform configurations
- Refactor SocialLinksInput, AboutMe components, and useUserInfoForm to use shared utilities
- Add missing social media icons to jobs page SocialMediaIconMap
- Reduce code duplication by ~400 lines across components
- Create generic platform system (platforms.tsx) with shared core and
  context-specific extensions for org/user profiles
- Refactor socialLink.tsx and platformDetection.tsx to use generic platform system
- Remove unused AboutMe widget component and spec file (dead code)
- Add toast notifications for better user feedback in SocialLinksInput
- Add code review guidelines to AGENTS.md for dead code cleanup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants